package com.cy.jt.Service;

import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service

public class MemoryService {

    public List<Map<String,Object>> list(){
        System.out.println("Get Data from Database");
        //假设如下数据来自于数据库
        Map<String,Object> m1=new HashMap<>();
        m1.put("id",100);
        m1.put("title","title-A");
        Map<String,Object> m2=new HashMap<>();
        m2.put("id",101);
        m2.put("title","title-B");
        List<Map<String,Object>> list=new ArrayList<>();
        list.add(m1);
        list.add(m2);
        return list;
    }
}